package spark.graphics.scenegraph;

import spark.math.Vector3;
import spark.math.Matrix;
import spark.math.Vector2;
import spark.graphics.Renderer;

public class TranslationNode extends SceneGraphNode {
	private Vector3 translation;

	public TranslationNode(Vector3 translation) {
		this.translation = translation;
	}

	public TranslationNode(Vector2 translation) {
		this.translation =  new Vector3(translation);
	}

	@Override
	public void prepare() {
		Renderer.getInstance().getGl().glPushMatrix();
		Renderer.getInstance().getGl().glTranslatef(translation.x, translation.y, translation.z);
	}

	@Override
	protected void cleanup() {
		Renderer.getInstance().getGl().glPopMatrix();
	}
}